/*
 * @(#) DateConvert.java  1.0  2004-4-13
 *
 * Copyright 2003 by LongTop Corporation.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * LongTop Corporation ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with LongTop.
 */

package com.cnc.bas.util;

import org.apache.commons.beanutils.Converter;

import java.sql.Timestamp;


/**
 * User: Du bf
 * Date: 2004-4-13
 * Time: 12:10:18
 */
public class DateConvert implements Converter {

    public DateConvert() {
    }

    public Object convert(Class type, Object value) {
        if (value == null) return null;
        if (value.toString().equals("")) return null;
        Timestamp date = new Timestamp(LTFormatUtil.parseDatetime((String) value).getTime());
        return date;
    }
}

